﻿using kmaraszkiewicz.Models;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using System.Web;

namespace kmaraszkiewicz.Controllers
{
    public class HelperController : Controller
    {
        private PortfolioEntities db = new PortfolioEntities();

        public PartialViewResult Skills()
        {
            return PartialView(db.Skills.ToList());
        }

        public PartialViewResult Slide()
        {
            foreach (var project in db.Projects)
            {
                project.Description = HttpUtility.HtmlDecode(project.Description);
                project.Photos = db.Photos.Where(p => p.ProjectId == project.ProjectId).ToList();
            }
            db.Projects.Include("Photos");
            return PartialView(db.Projects.ToList());
        }
    }
}
